<template>
  <div class="login_container">
    <!--
            一行有24格，
            :xs表示如果屏幕宽度小于768px，那么左半边就不显示，全都显示右半边的内容
        -->
    <el-row>
      <el-col :span="12" :xs="0"></el-col>
      <el-col :span="12" :xs="24">
        <el-form class="login_form">
          <h1>Hello</h1>
          <h2>欢迎来到项目</h2>
          <el-form-item>
            <el-input :prefix-icon="User" v-model="loginForm.username"></el-input>
          </el-form-item>
          <el-form-item>
            <el-input type="password" :prefix-icon="Lock" v-model="loginForm.password" show-password></el-input>
          </el-form-item>
          <el-form-item>
            <el-button class="login_btn" type="primary" size="default">登录</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>

<script setup lang="ts">
import {User,Lock} from '@element-plus/icons-vue';
import { reactive } from 'vue';

// 收集账号和密码的数据
let loginForm = reactive({username:'admin',password:'111111'})

</script>

<style scoped lang="scss">
.login_container {
  width: 100%;
  height: 100vh; //视图区域撑满
  background: url('@/assets/images/background.jpg') no-repeat;
  background-size: cover; //把div全都覆盖
  .login_form {
    position: relative;
    width: 80%;
    top: 30vh;
    background: url('@/assets/images/login_form.png') no-repeat;
    background-size: cover;
    h1 {
      color: white;
      font-size: 40px;
    }
    h2 {
      color: white;
      font-size: 20px;
      margin: 20px 0px; //上下间隔20px，左右间隔0px
    }
    .login_btn{
        width:100%;
    }
  }
}
</style>